<?php

use Faker\Factory;
use Illuminate\Database\Seeder;

class FinaBankAccountTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //先清空表
        DB::table('wy_fina_bank_account')->truncate();
        //实例化faker类
        $faker = Factory::create('zh_CN');//生成中文数据
        //循环
        for ($i = 1; $i <= 5; $i++) {
            DB::table('wy_fina_bank_account')->insert([
                'user_id'               => mt_rand(1, 30),
                'account_name'          => $faker->name,
                'account_bank_id'       => mt_rand(1, 5),
                'account_branch_id'     => mt_rand(1, 5),
                'account_idcode'        => $faker->PhoneNumber . $faker->PhoneNumber,
                'balance'               => mt_rand(100, 1000),
                'verify_code'           => mt_rand(100, 100000),
                'stat_history_income'   => mt_rand(100, 100000),
                'stat_history_outcome'  => mt_rand(100, 100000),
                'stat_daily_income'     => mt_rand(100, 100000),
                'stat_daily_outcome'    => mt_rand(100, 100000),
                'last_transaction_time' => date('Y-m-d H:i:s'),
            ]);
        }
    }
}
